<?php
class Unit_Form_Unit_Insert extends Zend_Form
{
	public function __construct(Zend_Controller_Action $controller)
	{
		//unit_code
		$unit_code=$this->createElement ( 'text', 'unit_code' )
		->setLabel ( $controller->getHelper('common')->getCaption('unit_code') )
		->setRequired(true)
		;
		
		//unit_name
		$unit_name=$this->createElement ( 'text', 'unit_name' )
		->setLabel ( $controller->getHelper('common')->getCaption('unit_name') )
		->setRequired(true)
		;
		
		//unit_note
		$unit_note=$this->createElement ( 'textarea', 'unit_note' )
		->setLabel ( $controller->getHelper('common')->getCaption('unit_note') )
		;
		
		//unit_status
		$unit_status=$this->createElement ( 'radio', 'unit_status' )
		->setLabel ( $controller->getHelper('common')->getCaption('unit_status') )
		->setMultiOptions(array(1=>'Kích hoạt',0=>'Vô hiệu'))
		->setValue(1)
		;
		
		$this->addElements ( array (
			$unit_code,
			$unit_name,
			$unit_note,
			$unit_status,
		) );	
		
		$controller->getHelper ( 'common' )->form ( $this );
	}
}